import * as React from 'react'
import { getClassName } from '../utils'

interface IProps {
    className?: string
    label?: string
    labelBgColor?: string
}

export default class Divider extends React.Component<IProps, any> {

    public static defaultProps = {
        labelBgColor: '#fff'
    }

    public render(): JSX.Element {
        const { className, label, labelBgColor } = this.props
        return (
            <div className={getClassName('divider', className)}>
                <div className={getClassName('divider_label')} style={{background: labelBgColor}}>
                    {label}
                </div>
            </div>
        )
    }
}